package com.neusoft.yiyang.common.entity.bed.vto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.neusoft.yiyang.common.entity.bed.Bed;
import com.neusoft.yiyang.common.entity.bed.BedUsage;
import com.neusoft.yiyang.common.enums.BedStatus;
import lombok.Data;

import java.util.Date;

@Data
public class BedBedUsage {

    private Integer buildingNo; // 楼栋号
    private Integer floor; // 楼层
    private String roomNumber; // 房间号
    private Integer bedNo; // 床号

    private BedStatus status; // 床位状态，使用枚举类型

    private Integer isDeleted; // 逻辑删除标记

    private Integer bedUsageId; // 使用记录ID
    private Integer customerId; // 客户ID
    private Integer bedId; // 床位ID
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startDate; // 使用开始时间
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endDate; // 使用结束时间‘

    public BedBedUsage(Bed bed, BedUsage bedUsage) {
        this.buildingNo = bed.getBuildingNo();
        this.floor = bed.getFloor();
        this.roomNumber = bed.getRoomNumber();
        this.bedNo = bed.getBedNo();
        this.status = bed.getStatus();
        this.isDeleted = bed.getIsDeleted();
        this.bedUsageId = bedUsage.getBedUsageId();
        this.customerId = bedUsage.getCustomerId();
        this.bedId = bedUsage.getBedId();
        this.startDate = bedUsage.getStartDate();
        this.endDate = bedUsage.getEndDate();
    }

    public BedBedUsage() {
    }
}
